import {DrawType} from "@/components/map/interface";

export interface Group{
    nodeType: "group",
    name: string,
    deptId: string,
    id: string,
    nodeId: `g-${Group["id"]}`,
    parentId: string,
    totalDeviceNum: number
    onlineDeviceNum: number
    children: Group[] | []
}

export interface Company{
    nodeType: "company",
    name: string,
    id: string,
    nodeId: `i-${Group["id"]}`,
    parentId: string,
    totalDeviceNum: number
    onlineDeviceNum: number
    deviceOnlineNum: number
    totalDeviceOnlineNum: number
    children: Company[] | Group[] | []
}

export interface Device{
    nodeType: "device"
    nodeId: `d-${Device["imei"]}`,
    imei: string
    address: string
    direction: number
    companyId: string
    groupId: string
    icon: string
    jt1078Avch: number
    jt1078Avset: string
    latitude: number
    longitude: number
    speed: number
    plateNo: string
    subTitle: string
    connectionStatus: string
    [key: string]: any
}

export interface Camera {
    nodeType: 'camera'
    nodeId: `c-${string}-${Camera["channel"]}`,
    parentNodeId: `d-${string}`
    plateNoName: string
    channel: number
    plateNo: string
    /** 当前播放的窗口下标*/
    index: number
    playerUrl: string
}

export interface Geofence {
    nodeType: 'geofence'
    id: string | undefined
    nodeId: `geofence-${string}`,
    companyId: number | undefined
    name: string
    type: DrawType
    icon: string
    area: string
    [key: string]: any
}